<template>
  <div id="header-img">
    <header id="home-panel-header" class="mui-bar mui-bar-nav">
      <h1 class="mui-title" id="page-title">{{ title }}</h1>
      <a class="mui-pull-left" id="myheader" @click="toMyData">
        <img :src="user_header" />
      </a>
      <a @click="showExtNav" class="mui-icon mui-icon-plusempty mui-pull-right"></a>
    </header>
    <div
      @click="isShowExtNav = false"
      :class="isShowExtNav ? 'show-extend-nav-panel active' : 'show-extend-nav-panel'"
    >
      
      
    </div>
<ul :class="isShowExtNav ? 'extend-nav active' : 'extend-nav'">
  <span class="point"></span>
        <li @click="extendNavAction('CreateGroupChat')">创建群聊</li>
        <li @click="extendNavAction('AddFriend')">加好友/群</li>
        <li @click="extendNavAction('RichScan')">扫一扫</li>
        <li @click="extendNavAction('ReleaseTask')">发布任务</li>
      </ul>
    <div class="mui-input-row mui-search search-panel">
      <input
        type="search"
        placeholder="搜索"
        class="mui-input-clear"
        data-input-clear="1"
        data-input-search="1"
      />
      <span class="mui-icon mui-icon-clear mui-hidden"></span>
      <span @click="goAddFriend" class="mui-placeholder">
        <span></span>
      </span>
    </div>
  </div>
</template>
<script>
export default {
  data() {
    return {
      user_header: "",
      title: "",
      isShowExtNav: false
    };
  },
  created() {
    this.title = this.$attrs.title;
    var user = localStorage.getItem("Now_User");
    user = JSON.parse(user);
    this.user_header = user.user_header;
  },
  methods: {
    goAddFriend: function() {
      this.$router.push({ path: "/AddFriend" });
    },
    toMyData: function() {

      this.$router.back = true;
      this.$router.push({ path: "Account" });
    },
    showExtNav: function() {
      this.isShowExtNav = true;
    },
    extendNavAction : function(href){
      this.$router.push({ path: href });
    }
  }
};
</script>
<style>
.show-extend-nav-panel {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.1);
  z-index: 666;
  display: none;
}
.show-extend-nav-panel.active {
  display: block;
}
.extend-nav {
  height: 150px;
  width: 120px;
  background-color: #ffffff;
  border-radius: 10px;
  position: fixed;
  top: 45px;
  right: 8px;
  z-index: 999;
  text-align: center;
  transform-origin: right top;
  transform: scale(0);
  transition: all 0.5s;
}
.extend-nav.active {
  transform: scale(1);
  transition: all 0.5s;
}
span.point {
  display: block;
  height: 0;
  width: 10px;
  border: 10px solid #ffffff;
  border-color: transparent transparent #ffffff transparent;
  position: absolute;
  top: -18px;
  right: 5px;
}
.extend-nav li {
  line-height: 36px;
}
</style>